<?php
$this->Html->addCrumb('Passcodes', '/admin/passcodes');
$this->Html->addCrumb('Add');
?>
<?php 
$this->Html->scriptStart(array('inline' => false));
echo '
      $(function(){
        $("#PasscodeAdminAddForm").TWS_Form( {
          validate : {
          rules : {
            PasscodeId : {required : true, help : "This is the passcode that is entered by the user when they register"},
            PasscodeRoleName : {help : "This is the role or level of access that is associated with the passcode", required : true}
          }
          }});
        });
       ';
$this->Html->scriptEnd();
?>
<h1>Add Passcode</h1>

<?php echo '<div id="actionLink"><p>'.$this->Html->link('Back to list of Passcodes',array('action'=>'index',$this->layout=>true)).'</p></div>'; ?>

<?php echo $this->element('errors', array('errors' => isset($errors)? $errors : null)); ?>
<?php

echo $this->TWSForm->create('Passcode',  array(
    'inputDefaults' => array(
        'div' => array('class'=>'row')),
        'class'=>'inlineForm',
        'type'=>'file'));

echo $this->TWSForm->input('id', array('name'=>'PasscodeId', 'type'=>'text', 'label'=>'<span class="required">*</span>Passcode'));
echo $this->TWSForm->input('role_name', array('name'=>'PasscodeRoleName', 'type'=>'select', 'label'=>'<span class="required">*</span>Role', 'options'=>$options));
echo $this->TWSForm->end( array("label"=>"Add", "class"=>"button"));


?>